<template>
  <div class="gallary" @click.stop="handleGallaryClick">
    <div class="wraper">
      <swiper :options= 'swiperOptions'>
        <swiper-slide
          v-for="(item, index) in gallaryImgs"
          :key='index'
        >
          <img class="swipe-img" :src="item"  />
        </swiper-slide>
        <div class="swiper-pagination" slot="pagination"></div>
      </swiper>
    </div>
  </div>
</template>

<script>
export default{
  name: 'gallary',
  props: {
    gallaryImgs: Array
  },
  data () {
    return {
      swiperOptions: {
        pagination: '.swiper-pagination',
        paginationType: 'fraction',
        observer: true,
        observeParents: true
      }
    }
  },
  methods: {
    handleGallaryClick () {
      // console.log('123')
      this.$emit('close')
    }
  }
}
</script>

<style lang="stylus" scoped>
.gallary >>> .swiper-container
  overflow: inherit
.gallary
  position: fixed
  display: flex
  z-index: 99
  top: 0
  left: 0
  right: 0
  bottom: 0
  background: #000
  flex-direction: column
  justify-content: center
  .swipe-img
    width: 100%
  .swiper-pagination
    bottom: -1rem
</style>
